<template>
  <div class="weekly-report">
    <h2>产品事业部周工作报告</h2>
    <el-form  label-width="120px">
      <el-row :gutter="20">
        <el-col :span="8">
          <el-form-item label="当前周">
            <el-date-picker
              v-model="workWeek"
              type="week"
              placeholder="选择周"
              format="第WW周"
              @change="weekChange">
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>

    <el-table
        :data="tableData"
        border
        style="width: 100%; margin-top: 20px">
      <el-table-column
          prop="weekday"
          label="工作日"
          width="120">
      </el-table-column>
      <el-table-column
          prop="content"
          label="工作内容">
        <template slot-scope="scope">
          <el-input
              type="textarea"
              :autosize="{ minRows: 4, maxRows: 6}"
              v-model="scope.row.content"
              placeholder="请输入工作内容">
          </el-input>
        </template>
      </el-table-column>
    </el-table>

    <div style="margin-top: 20px; text-align: center;">
      <el-button type="primary" @click="submitReport">提交报告</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'workLog',
  data() {
    return {
      workWeek: '2025-07-18',
      currentWeek: "",
      tableData: [
        { weekday: '周一' },
        { weekday: '周二' },
        { weekday: '周三' },
        { weekday: '周四' },
        { weekday: '周五' }
      ]
    }
  },
  created() {

  },
  methods: {
    submitReport() {

      console.log('提交的报告数据:', reportData)
      this.$message.success('报告提交成功')
      // 这里可以添加实际的提交逻辑
    },

    weekChange() {
      console.log(this.workWeek);
      this.workWeek = '2025-07-18';
    }
  },
}
</script>

<style scoped>
.weekly-report {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

h2 {
  text-align: center;
  margin-bottom: 20px;
}
</style>
